import React, { Component } from "react";  /* eslint-disable eqeqeq */
import PubSub from 'pubsub-js'
import { meshLog, SPRemove, SPGet, SPSet } from "../../../../config";
import "./changeSet.less";


import { getMqtt } from '../../../../api/index.js';

export default class changeSet extends Component {
  constructor(a) {
    super(a);
    this.state = {
      showDiaolg: 'hidden',
    }
  }
  componentWillUnmount() {


  }
  async componentDidMount() {
    meshLog('1111',);

  }


  mqttsend1 = async () => {
    const date = {
      code: 'ble',
      ble: 'FFFF20200C620000FFFFE4A507FAD30201C00202',
      dmx: '5A4E5A4D03000000',
    }
    let result = await getMqtt(date)
    meshLog('result', result);
  }
  mqttsend2 = async () => {
    const date = {
      code: 'dmx',
      dmx: '5A4E5A4D0200FF00',
      ble: 'FFFF20200C620000FFFFE4A507FAD30200C00202',
    }
    let result = await getMqtt(date)
    meshLog('result', result);
  }
  mqttsend3 = async () => {
    const date = {
      code: 'set_number',
      ble: 'FFFF20200C620000FFFFE4A507FAD30201C00202',
      dmx: '5A4E5A4D03000000',
    }
    let result = await getMqtt(date)
    meshLog('result', result);
  }
  mqttsend = async () => {
  }
  render() {
    return (
      <div className="neirong" >
        <div className="zuo" id="areaheight">
          <div style={{ width: 340, marginTop: 200 }}>
            <h2 onClick={() => { this.mqttsend1() }} >切换蓝牙</h2>
            <h2 onClick={() => { this.mqttsend2() }} >切换dmx</h2>
            <h2 onClick={() => { this.mqttsend3() }} >测试mqtt分组</h2>
          </div>
        </div>
        <div className="zuida">
          <div className="you">
            <div style={{ textAlign: 'center', marginTop: 200 }}>
              <h1 onClick={() => { this.mqttsend() }}  >home</h1>
            </div>
          </div>
        </div>
      </div >
    )
  }
}
